package com.tepth.vehiclemaintenance.net;

import com.tepth.vehiclemaintenance.bean.ChooseOperator;
import com.tepth.vehiclemaintenance.bean.DetailDriverRemark;
import com.tepth.vehiclemaintenance.bean.MaintainDriverRemark;
import com.tepth.vehiclemaintenance.bean.MaintainListWork;
import com.tepth.vehiclemaintenance.bean.SearchPartResult;
import com.tepth.vehiclemaintenance.bean.User;
import com.tepth.vehiclemaintenance.bean.VehicleMaintain;

import java.util.ArrayList;

import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by zhangyu on 2016/6/15.
 */
public interface ApiService {
    @GET(ApiUrl.BUS_LIST)
    Observable<ApiModel<ArrayList<VehicleMaintain>>> getMainList(@Query("authKey") String authKey,
                                                                 @Query("startTime") String startTime,
                                                                 @Query("endTime") String endTime);

    @GET(ApiUrl.NOT_FINISH_WORK_DATE)
    Observable<ApiModel<ArrayList<String>>> getNotFinishWorkDate(@Query("authKey") String authKey,
                                                                 @Query("startDate") String startTime,
                                                                 @Query("endDate") String endTime);

    @GET(ApiUrl.Login)
    Observable<ApiModel<User>> login(@Query("loginName") String account,
                                     @Query("password") String password,
                                     @Query("appName") String appName,
                                     @Query("appVersion") String appVersion,
                                     @Query("osName") String osName,
                                     @Query("osVersion") String osVersion);

    @GET(ApiUrl.START_WORK)
    Observable<ApiModel<String>> startWork(@Query("authKey") String authKey,
                                           @Query("maintenanceId") int id);

    @GET(ApiUrl.VEHICLE_HISTORY)
    Observable<ApiModel<ArrayList<VehicleMaintain>>> getVehicleHistory(@Query("authKey") String authKey,
                                                                       @Query("startTime") String startTime,
                                                                       @Query("endTime") String endTime,
                                                                       @Query("vehicleNumber") String vehicleNumber);

    @GET(ApiUrl.DRIVER_REMARK)
    Observable<ApiModel<ArrayList<MaintainDriverRemark>>> getDriverRemark(@Query("authKey") String authKey,
                                                                          @Query("maintenanceId") int maintenanceId);

    @GET(ApiUrl.MAINTAIN_LIST_WORK)
    Observable<ApiModel<ArrayList<MaintainListWork>>> getMaintainListWork(@Query("authKey") String authKey,
                                                                          @Query("maintenanceId") int maintenanceId);

    @GET(ApiUrl.ITEM_DETAIL)
    Observable<ApiModel<DetailDriverRemark>> getItemDetail(@Query("authKey") String authKey,
                                                           @Query("maintenanceId") int maintenanceId);

    @GET(ApiUrl.GET_ALL_SUGGEST)
    Observable<ApiModel<ArrayList<ChooseOperator>>> getAllSuggests(@Query("authKey") String authKey);

    @GET(ApiUrl.GET_OPERATION_LIST)
    Observable<ApiModel<ArrayList<MaintainListWork.ListContentsBean.ListRemarkBean.OperationBean>>>
    getOperatorList(@Query("authKey") String authKey);

    @GET(ApiUrl.GET_COMMON_COMPONENT)
    Observable<ApiModel<SearchPartResult>> getCommonComponent(@Query("authKey") String authKey,
                                                              @Query("top") int count);

    @GET(ApiUrl.SEARCH_PART)
    Observable<ApiModel<SearchPartResult>> searchPart(@Query("authKey") String authKey,
                                                      @Query("name") String name);

    @GET(ApiUrl.PUNCH_CARD)
    Observable<ApiModel<String>> punchCard(@Query("authKey") String authKey,
                                           @Query("maintenanceId") int maintenanceId,
                                           @Query("workContentsJson") String workContentsJson,
                                           @Query("confirmJson") String confirmJson,
                                           @Query("completedRemark") String completedRemark);

}
